package Test07;

//多线程常用方法

/*
public final void join()插入线程/插队线程
 */
public class Test08 {
    public static void main(String[] args) throws InterruptedException {

        MyThread08 t = new MyThread08();
        t.setName("土豆");
        t.start();

        //表示把t这个线程，插入到当前线程之前。
        //t:土豆
        //当前线程:main线程
        t.join();

        for (int i = 0; i < 10; i++) {
            System.out.println("main线程" + "@" + i);
        }
    }
}

class MyThread08 extends Thread {

    @Override
    public void run() {
        for (int i = 1; i <= 100; i++) {
            System.out.println(getName() + "@" + i);
        }
    }
}
